package com.yfp.operation.mapper;

import com.yfp.common.datascope.annotation.DataScope;
import com.yfp.operation.domain.ClientIntegral;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.operation.domain.dto.ClientIntegralListDTO;
import com.yfp.operation.domain.dto.IntegralHistoryDTO;
import com.yfp.operation.domain.vo.ClientIntegralListVO;
import com.yfp.operation.domain.vo.IntegralHistoryVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author admin
* @description 针对表【client_integral(客户积分)】的数据库操作Mapper
* @createDate 2025-03-05 14:42:03
* @Entity domain.com.yfp.operation.ClientIntegral
*/
public interface ClientIntegralMapper extends BaseMapper<ClientIntegral> {

    /**
     * 积分列表
     * @param clientIntegralListDTO
     * @return
     */
    @DataScope(deptAlias = "p")
    List<ClientIntegralListVO> clientIntegralList(ClientIntegralListDTO clientIntegralListDTO);

    /**
     * 获取最近交易时间
     * @param clientIds
     * @return
     */
    List<ClientIntegralListVO> latelyTradingHour(@Param("clientIds") List<String> clientIds);

    /**
     * 统计已使用积分
     * @param clientIds
     * @return
     */
    List<ClientIntegralListVO> consumeIntegral(@Param("clientIds") List<String> clientIds, @Param("type") Integer type, @Param("status") Integer status);

    /**
     * 积分历史记录
     * @param integralHistoryDTO
     * @return
     */
    List<IntegralHistoryVO> integralHistory(IntegralHistoryDTO integralHistoryDTO);

    /**
     * 添加积分记录
     * @param clientIntegral
     */
    void add(ClientIntegral clientIntegral);
}




